﻿using System.ComponentModel.DataAnnotations;

namespace IotModel
{
    public class DeviceModel
    {
        public string DeviceId { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string DeviceName { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public uint Index { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }

        public DriverModel Driver { get; set; }
        /// <summary>
        /// 驱动
        /// </summary>
        public Guid? DriverId { get; set; }
        /// <summary>
        /// 启动
        /// </summary>
        public bool AutoStart { get; set; }
        /// <summary>
        /// 变化上传
        /// </summary>
        public bool CgUpload { get; set; }
        /// <summary>
        /// 归档周期ms
        /// </summary>
        public uint EnforcePeriod { get; set; }
        /// <summary>
        /// 指令间隔ms
        /// </summary>
        public uint CmdPeriod { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        public DeviceTypeEnum DeviceTypeEnum { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateBy { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        public string UpdateBy { get; set; }

        public List<DeviceConfigModel> DeviceConfigs { get; set; }
        /// <summary>
        /// mqtt推送配置信息
        /// </summary>
        public MqttServerModel? MqttServer { get; set; }
        public List<DeviceVariableModel> DeviceVariables { get; set; }
    }
}